package com.kongmou.springReview.advanced.SpringTest;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringTestConfig.class })
@ActiveProfiles(profiles = { "prod" })
public class TestTestBean {

	@Autowired
	private TestBean testBean;

	@Test
	public void testTestBean() {
		String expect = "From prod";
		String actual = testBean.getContent();
		Assert.assertEquals(expect, actual);
	}
	
	@Test
	public void test2TestBean() {
		String expect = "From dev";
		String actual = testBean.getContent();
		Assert.assertNotEquals(expect, actual);
	}

}
